import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: 'id',
    align: "center", resizable: true,
    dataIndex: 'id'
  },
  {
    title: '项目',
    align: "center", resizable: true,
    dataIndex: 'projectId_dictText'
  },
  {
    title: '子项目',
    align: "center", resizable: true,
    dataIndex: 'subProjectId_dictText'
  },
  {
    title: '总包信息',
    align: "center", resizable: true,
    dataIndex: 'companyInfoId_dictText'
  },
  {
    title: '销售方名称',
    align: "center", resizable: true,
    dataIndex: 'sellerName',
    width:200
  },
  {
    title: '价税合计',
    align: "center", resizable: true,
    dataIndex: 'totalAmountWithTax'
  },
  {
    title: '付款情况',
    align: "center", resizable: true,
    dataIndex: 'payment',
    width:200
  },
  {
    title: '付款记录',
    align: "center", resizable: true,
    dataIndex: 'requestList',
    width:200
  },




  {
    title: '发票号码',
    align: "center", resizable: true,
    dataIndex: 'invoiceNumber',
    width:200
  },

  {
    title: '发票文件',
    align: "center", resizable: true,
    dataIndex: 'invoiceFile',
  },
  {
    title: '状态',
    align: "center", resizable: true,
    dataIndex: 'invoiceStatus'
  },
  {
    title: '项目名称',
    align: "center", resizable: true,
    dataIndex: 'projectName'
  },

 /* {
    title: '金额',
    align: "center", resizable: true,
    dataIndex: 'amount'
  },
  {
    title: '税率',
    align: "center", resizable: true,
    dataIndex: 'taxRate'
  },

  {
    title: '税额',
    align: "center", resizable: true,
    dataIndex: 'taxAmount'
  },*/

  {
    title: '开票日期',
    align: "center", resizable: true,
    dataIndex: 'invoiceDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },


];

// 高级查询数据
export const superQuerySchema = {
  request: {title: '申请id',order: 0,view: 'text', type: 'string',},
  projectId: {title: '项目',order: 1,view: 'list', type: 'string',dictTable: "c_project_application", dictCode: 'id', dictText: 'project_name',},
  subProjectId: {title: '子项目',order: 2,view: 'list', type: 'string',dictTable: "c_sub_project", dictCode: 'id', dictText: 'sub_project_name',},
  invoiceFile: {title: '发票文件',order: 3,view: 'file', type: 'string',},
  invoiceStatus: {title: '状态(审核中，入库)',order: 4,view: 'list', type: 'string',dictCode: '',},
  projectName: {title: '项目名称',order: 5,view: 'text', type: 'string',},
  taxAmount: {title: '税额',order: 6,view: 'number', type: 'number',},
  invoiceDate: {title: '开票日期',order: 7,view: 'date', type: 'string',},
  invoicer: {title: '开票人',order: 8,view: 'text', type: 'string',},
  invoiceType: {title: '发票类型',order: 9,view: 'text', type: 'string',},
  totalAmountWithTax: {title: '价税合计（小写）',order: 10,view: 'number', type: 'number',},
  taxRate: {title: '税率/征收率',order: 11,view: 'number', type: 'number',},
  totalAmountWithTaxUpper: {title: '价税合计（大写）',order: 12,view: 'text', type: 'string',},
  remarks: {title: '备注',order: 13,view: 'textarea', type: 'string',},
  invoiceNumber: {title: '发票号码',order: 14,view: 'text', type: 'string',},
  amount: {title: '金额',order: 15,view: 'number', type: 'number',},
  sellerName: {title: '销售方名称',order: 16,view: 'text', type: 'string',},
  sellerTaxId: {title: '销售方统一社会信用代码/纳税人识别号',order: 17,view: 'text', type: 'string',},
  buyName: {title: '购买方名称',order: 18,view: 'text', type: 'string',},
  buyTaxId: {title: '购买方统一社会信用代码/纳税人识别号',order: 19,view: 'text', type: 'string',},
};
